home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / applications / wp / textra16.lha / Textra116 / Scripts / JForth_Scripts / MarkColons.textra < prev    next >
Encoding:
Text File  |  1993-10-14  |  1.9 KB  |  75 lines

  1.     /*******************************************************************
  2.      *      TEXTRA-AREXX script -- Mike Haas, 1993, Public Domain      *
  3.      *                                                                 *
  4.      *      For use with TEXTRA, the GUI-based Amiga Text Editor.      *
  5.      *                                                                 *
  6.      *  If you enhance or write your own Textra scripts, please send   *
  7.      *   to me... especially if you want them added to the package.    *
  8.      *******************************************************************/
  9.  
  10. /*
  11. ** This script is handy for JForth programmers. 
  12. ** It requires version 1.15, rexx level 7, of Textra.
  13. **
  14. ** It will find, highlight and mark all colon definitions
  15. ** IF the ':' operator is in the 1st column.
  16. **
  17. ** Especially useful when assigned to a Textra Function
  18. ** key or CTRL-key macro.
  19. **
  20. ** Also processes :struct definitions, anything
  21. ** that begins with a ':' in the first column.
  22. ** (:CLASS, for example?)
  23. **
  24. ** Mike Haas, Oct 7, 1993
  25. **
  26. ** This program is hereby placed in the public domain.
  27. **
  28. */
  29.  
  30. options results
  31.  
  32. /*check Textra version, must be rexx level 7 at least for MARKSELECT */
  33. rex = 0; result = "NOTSUPPORTED"
  34. address 'TEXTRA' 'textraversion'
  35. parse var result maj min rex
  36. if (result == "NOTSUPPORTED") | (rex < 7) then do
  37.         address 'TEXTRA' 'notify "This version of Textra cannot run this script."'
  38.         exit
  39. end
  40.  
  41. done = 0
  42.  
  43. gotoxy 0 0
  44.  
  45. do while (done == 0)
  46.  
  47.     checkcancel; if (result == CANCEL) then exit
  48.     
  49.     find ":"
  50.     if result == "OK" then  do
  51.  
  52.         get select position
  53.         parse var result stx' 'sty' 'enx' 'eny
  54.         
  55.         if (stx == 0) then do
  56.         
  57.             hopselect next word
  58.             get select text; parse var result zero' 'thename
  59.             markselect thename
  60.             
  61.             /*
  62.             ** Uncomment the next line if you want this script
  63.             ** to exit after finding and marking one JForth word.
  64.             */
  65.             
  66.             /* done = 1 */
  67.         end
  68.     
  69.     end
  70.     else
  71.         done = 1
  72.     
  73. end
  74.     
  75.